package com.ys.entity.mail;

import java.util.Date;
import javax.persistence.Table;
import com.alibaba.fastjson.annotation.JSONField;
import com.ys.annotation.YsField;
import com.ys.entity.base.BaseEntity;
/**
*/
@Table(name="MAIL_Receiver", catalog="Id")
public class MailReceiver extends BaseEntity<MailReceiver> {

	@YsField(nameDataBase="Id", nameJava="id", typeDataBase="bigint")
	private Long id;
	@YsField(nameDataBase="MainId", nameJava="mainId", typeDataBase="bigint")
	private Long mainId;
	@YsField(nameDataBase="UserId", nameJava="userId", typeDataBase="varchar")
	private String userId;
	@YsField(nameDataBase="Type", nameJava="type", typeDataBase="tinyint")
	private Integer type;
	@YsField(nameDataBase="StateRead", nameJava="stateRead", typeDataBase="tinyint")
	private Integer stateRead;
	@YsField(nameDataBase="Status", nameJava="status", typeDataBase="tinyint")
	private Integer status;
	@JSONField(format = "yyyy-MM-dd HH:mm:ss")
	@YsField(nameDataBase="CreateTime", nameJava="createTime", typeDataBase="datetime")
	private Date createTime;
	@JSONField(format = "yyyy-MM-dd HH:mm:ss")
	@YsField(nameDataBase="UpdateTime", nameJava="updateTime", typeDataBase="datetime")
	private Date updateTime;

	public Long getId() {
		return id;
	}
	public MailReceiver setId(Long id) {
		this.id = id;
		return this;
	}
	public Long getMainId() {
		return mainId;
	}
	public MailReceiver setMainId(Long mainId) {
		this.mainId = mainId;
		return this;
	}
	public String getUserId() {
		return userId;
	}
	public MailReceiver setUserId(String userId) {
		this.userId = userId;
		return this;
	}
	public Integer getType() {
		return type;
	}
	public MailReceiver setType(Integer type) {
		this.type = type;
		return this;
	}
	public Integer getStateRead() {
		return stateRead;
	}
	public MailReceiver setStateRead(Integer stateRead) {
		this.stateRead = stateRead;
		return this;
	}
	public Integer getStatus() {
		return status;
	}
	public MailReceiver setStatus(Integer status) {
		this.status = status;
		return this;
	}
	public Date getCreateTime() {
		return createTime;
	}
	public MailReceiver setCreateTime(Date createTime) {
		this.createTime = createTime;
		return this;
	}
	public Date getUpdateTime() {
		return updateTime;
	}
	public MailReceiver setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
		return this;
	}

	public static MailReceiver mailReceiver(
		Long mainId,
		String userId,
		Integer type,
		Integer stateRead,
		Integer status
			) {
		MailReceiver entity = new MailReceiver();
		entity.setMainId(mainId);
		entity.setUserId(userId);
		entity.setType(type);
		entity.setStateRead(stateRead);
		entity.setStatus(status);
		return entity;
	}
}